let app = getApp();

Component({
	properties: {
		dialogHidden: {
			type: Boolean,
			value: false
		},
		// 这里定义了innerText属性，属性值可以在组件使用时指定
		tipText: {
			type: String,
			value: ' ',
		},

		confirmText: {
			type: String,
			value: '确定'
		},
	},
	data: {

	},
	methods: {
		getUserInfo: function () {
			let that = this;
			wx.getSetting({
				success(res) {
					if (!res.authSetting['scope.userInfo']) {
						wx.authorize({
							scope: 'scope.userInfo',
							success() {
								wx.setStorageSync("wx_auth", true);
								that.setData({
									dialogHidden: true
								})
							},
							fail() {
								wx.setStorageSync("wx_auth", false);
								that.setData({
									dialogHidden: true
								})
							}
						})
					} else {
						wx.setStorageSync("wx_auth", true);
						that.setData({
							dialogHidden: true
						});

						app.event.emit("wx_auth")
					}
				}
			});
		}
	}
});